package com.example.mydesignmodule.flyweight;

import java.util.Random;

/**
 * @author tgw
 * @date 2021/3/11
 * @describe
 */
class BuyTicket extends FlyweightTicket{

    private String from;
    private String to;

    public BuyTicket(String from, String to) {
        this.from = from;
        this.to = to;
    }

    @Override
    void showTicketInfo(String bunk) {
        float price = new Random().nextInt(100);
        System.out.println("购买从"+from+"到"+to+"车票价格："+price+"铺位："+bunk);
    }
}
